package com.yatb.trac.pojo.comparator;

import java.util.Comparator;

import com.yatb.trac.pojo.Utenti;

public class UsersOrderByCognomeNome implements Comparator<Utenti> {

	public int compare(Utenti userA, Utenti userB) {
		StringBuffer a = new StringBuffer();
		StringBuffer b = new StringBuffer();
		return a.append(userA.getCognome())
				.append(" ")
				.append(userA.getNome())
				.toString()
				.compareTo(
						b.append(userB.getCognome()).append(" ")
								.append(userB.getNome()).toString());
	}

}
